﻿<%@ Page Title="" Language="C#" MasterPageFile="~/BackOffice.Master" AutoEventWireup="true" CodeBehind="Vendor_Report.aspx.cs" Inherits="FYPDemo.Vendor_Report" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table>
        <tr>
            <td>
                <asp:Label ID="lblVendor" runat="server" Text="Vendor"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtVendor" runat="server"></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblEmail" runat="server" Text="Email"></asp:Label>
            </td>

            <td>
                <asp:TextBox ID="txtEmail" runat="server"></asp:TextBox>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblRegisteredFrom" runat="server" Text="Registered From"></asp:Label>
            </td>

            <td>
                <asp:TextBox ID="txtRegisteredFrom" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtRegisteredFrom"
                Format="yyyy-MM-dd" Enabled ="true">
                </asp:CalendarExtender>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblRegisteredTo" runat="server" Text="Registered To"></asp:Label>
            </td>

            <td>
                <asp:TextBox ID="txtRegisteredTo" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtRegisteredTo"
                Format="yyyy-MM-dd" Enabled ="true">
                </asp:CalendarExtender>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="Label1" runat="server" Text="Date From"></asp:Label>
            </td>

            <td>
                <asp:TextBox ID="txtDateFrom" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="txtDateFrom"
                Format="yyyy-MM-dd" Enabled ="true">
                </asp:CalendarExtender>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="Label2" runat="server" Text="Date To"></asp:Label>
            </td>

            <td>
                <asp:TextBox ID="txtDateTo" runat="server"></asp:TextBox>
                <asp:CalendarExtender ID="CalendarExtender4" runat="server" TargetControlID="txtDateTo"
                Format="yyyy-MM-dd" Enabled ="true">
                </asp:CalendarExtender>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Label ID="lblStatus" runat="server" Text="Status"></asp:Label>
            </td>

            <td>
                <asp:RadioButtonList ID="rbStatus" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="0" Selected="True">Activated</asp:ListItem>
                    <asp:ListItem Value="1">Deactivated</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>

        <tr>
            <td>
                <asp:Button ID="btnSearch" runat="server" Text="Search" 
                    onclick="btnSearch_Click" />
            </td>
            <td>
                <asp:Button ID="btnExport" runat="server" Text="Export" 
                    onclick="btnExport_Click" />
            </td>
        </tr>
    </table>

    <asp:GridView ID="VendorReport_Grid" runat="server" AutoGenerateColumns="False" 
        CellPadding="4" ForeColor="#333333" GridLines="None" >
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:TemplateField HeaderText = "No.">
                <ItemTemplate>
                    <%# Container.DataItemIndex + 1 %>
                </ItemTemplate>
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Member">
                <ItemTemplate>
                    <asp:Label ID="lblMemberName" runat="server"><%#Eval("Name") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Email">
                <ItemTemplate>
                    <asp:Label ID="lblEmailAddress" runat="server"><%#Eval("EmailAddress") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Phone">
                <ItemTemplate>
                    <asp:Label ID="lblPhone" runat="server"><%#Eval("Phone") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>

            <asp:TemplateField HeaderText = "Registered Date">
                <ItemTemplate>
                    <asp:Label ID="lblDateCreated" runat="server"><%#Eval("DateCreated") %></asp:Label>
                </ItemTemplate> 
            </asp:TemplateField>
            
            <asp:TemplateField HeaderText = "Money Earn">
                <ItemTemplate>
                    <asp:Label ID="lblAmountSpent" runat="server"><%#Eval("MoneyEarn") %></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#7C6F57" />
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#E3EAEB" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F8FAFA" />
        <SortedAscendingHeaderStyle BackColor="#246B61" />
        <SortedDescendingCellStyle BackColor="#D4DFE1" />
        <SortedDescendingHeaderStyle BackColor="#15524A" />
    </asp:GridView>

    <asp:Label ID="lblText" runat="server" Text="Total Vendor: "></asp:Label>&nbsp;&nbsp;
    <asp:Label ID="lblVendorCount" runat="server"></asp:Label>

    <asp:ToolkitScriptManager ID="ToolkitScriptManager2" runat="server">
    </asp:ToolkitScriptManager>
</asp:Content>
